home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / a_man / cat1 / syslogd.z / syslogd
Encoding:
Text File  |  1998-10-20  |  10.6 KB  |  265 lines

  1.  
  2.  
  3.  
  4. ssssyyyyssssllllooooggggdddd((((1111MMMM))))                                                        ssssyyyyssssllllooooggggdddd((((1111MMMM))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      syslogd - log systems messages
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ////uuuussssrrrr////eeeettttcccc////ssssyyyyssssllllooooggggdddd [ ----ffff_c_o_n_f_i_g_f_i_l_e ] [ ----mmmm_m_a_r_k_i_n_t_e_r_v_a_l ] [ ----pppp_l_o_g_p_i_p_e ] [ ----dddd ]
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _s_y_s_l_o_g_d reads and logs messages into a set of files described by the
  16.      configuration file /_e_t_c/_s_y_s_l_o_g._c_o_n_f.  Each message is one line.  A
  17.      message can contain a priority code, marked by a number in angle braces
  18.      at the beginning of the line.  Priorities are defined in <_s_y_s/_s_y_s_l_o_g._h>.
  19.      _s_y_s_l_o_g_d reads from the stream device /_d_e_v/_l_o_g, from an Internet domain
  20.      socket specified in /_e_t_c/_s_e_r_v_i_c_e_s, and from the special device /_d_e_v/_k_l_o_g
  21.      (to read kernel messages).
  22.  
  23.      _s_y_s_l_o_g_d reads its configuration when it starts up and whenever it
  24.      receives a hangup signal.  Lines in the configuration file have a
  25.      selector to determine the message priorities to which the line applies
  26.      and an _a_c_t_i_o_n.  The _a_c_t_i_o_n fields are separated from the selector by one
  27.      or more tabs.  A maximum of 50 lines can be specified.  It is recommended
  28.      that no more than 49 be used, or the LLLLOOOOGGGG____LLLLFFFFMMMMTTTT facility may not work
  29.      correctly; this facility is used by _l_o_g_i_n(1), among other programs.
  30.  
  31.      Selectors are semicolon separated lists of priority specifiers.  Each
  32.      priority has a _f_a_c_i_l_i_t_y describing the part of the system that generated
  33.      the message, a dot, and a _l_e_v_e_l indicating the severity of the message.
  34.      Symbolic names can be used.  An asterisk (****) selects all facilities,
  35.      while ddddeeeebbbbuuuugggg selects all levels.  All messages of the specified level or
  36.      higher (greater severity) are selected.  More than one facility can be
  37.      selected, using commas to separate them.  For example:
  38.  
  39.           *.emerg;mail,daemon.crit
  40.  
  41.      selects all facilities at the _e_m_e_r_g level and the _m_a_i_l and _d_a_e_m_o_n
  42.      facilities at the _c_r_i_t level.
  43.  
  44.      Known facilities and levels recognized by _s_y_s_l_o_g_d are those listed in
  45.      _s_y_s_l_o_g(3C) without the leading LLLLOOOOGGGG____.  The additional facility mmmmaaaarrrrkkkk logs
  46.      messages at priority LOG_INFO every 20 minutes (this interval can be
  47.      changed with the ----mmmm flag).  The mmmmaaaarrrrkkkk facility is not enabled by a
  48.      facility field containing an asterisk.  The level nnnnoooonnnneeee can be used to
  49.      disable a particular facility.  For example:
  50.  
  51.           *.debug;mail.none
  52.  
  53.      sends all messages _e_x_c_e_p_t mail messages to the selected file.
  54.  
  55.      The second part of each line describes where the message is to be logged
  56.      if this line is selected.  There are five forms:
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssyyyyssssllllooooggggdddd((((1111MMMM))))                                                        ssssyyyyssssllllooooggggdddd((((1111MMMM))))
  71.  
  72.  
  73.  
  74.      +o  A filename (beginning with a leading slash).  The file is opened in
  75.         append mode.
  76.  
  77.      +o  A hostname preceded by an at sign (@@@@).  Selected messages are
  78.         forwarded to the _s_y_s_l_o_g_d on the named host.
  79.  
  80.      +o  A comma-separated list of users.  Selected messages are written to
  81.         those users if they are logged in.
  82.  
  83.      +o  An asterisk.  Selected messages are written to all logged-in users.
  84.  
  85.      +o  A ||||, followed immediately by a program name, which is taken to be all
  86.         chars after the |||| up to the next tab; at least one action must follow
  87.         the tab.  The filter is expected to read stdin and write the filtered
  88.         response to stdout.  The filter receives the source and message
  89.         through stdin.  A filter can also access the priority, facility, and
  90.         hostname via environmental variables: PRIORITY, FACILITY, and FROM.
  91.         The values are stored as strings defined in <_s_y_s/_s_y_s_l_o_g._h>.  If the
  92.         filter exits with a non-zero value, the original message is logged, as
  93.         well as a message that the filter failed.  The filter has a limited
  94.         time (currently eight seconds) to process the message.  If the filter
  95.         exits with status 0 without writing any data, no message is logged.
  96.         The data to be read by the filter is not terminated with a newline,
  97.         nor should the data written have a newline appended.  See below for a
  98.         sample filter.
  99.  
  100.      Blank lines and lines beginning with #### are ignored.
  101.  
  102.      For example, the configuration file:
  103.  
  104.           kern.debug  |/usr/sbin/klogpp          /var/adm/SYSLOG
  105.           kern.debug  |/usr/sbin/klogpp          /dev/console
  106.           user,mail,daemon,auth,syslog,lpr.debug /var/adm/SYSLOG
  107.           kern.err    @ginger
  108.           *.emerg     *
  109.           *.alert     eric,beth
  110.           *.alert;auth.warning                   ralph
  111.  
  112.      filters all kernel messages through _k_l_o_g_p_p(1M) and writes them to the
  113.      system console and into /_v_a_r/_a_d_m/_S_Y_S_L_O_G and logs debug (or higher) level
  114.      messages into the file /_v_a_r/_a_d_m/_S_Y_S_L_O_G.  Kernel messages of error
  115.      severity or higher are forwarded to ggggiiiinnnnggggeeeerrrr.  All users are informed of
  116.      any emergency messages.  The users eeeerrrriiiicccc and bbbbeeeetttthhhh are informed of any
  117.      alert messages.  The user rrrraaaallllpppphhhh is informed of any alert message or any
  118.      warning message (or higher) from the authorization system.
  119.  
  120.      _s_y_s_l_o_g_d is started at system initialization from /_e_t_c/_i_n_i_t._d/_s_y_s_e_t_u_p.
  121.      Optional site-specific flags belong in /_e_t_c/_c_o_n_f_i_g/_s_y_s_l_o_g_d._o_p_t_i_o_n_s.  The
  122.      flags are:
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ssssyyyyssssllllooooggggdddd((((1111MMMM))))                                                        ssssyyyyssssllllooooggggdddd((((1111MMMM))))
  137.  
  138.  
  139.  
  140.      ----ffff_c_o_n_f_i_g_f_i_l_e     Specify an alternate configuration file.
  141.  
  142.      ----mmmm_m_a_r_k_i_n_t_e_r_v_a_l   Select the number of minutes between mark messages.
  143.  
  144.      ----dddd               Turn on debugging.  _s_y_s_l_o_g_d runs in the foreground and
  145.                       writes debugging information to stdout.
  146.  
  147.      ----pppp_l_o_g_p_i_p_e        Use the given name for the device instead of /_d_e_v/_l_o_g.
  148.  
  149.      _s_y_s_l_o_g_d rereads its configuration file when it receives a hangup signal,
  150.      SIGHUP.  To bring _s_y_s_l_o_g_d down, send it a terminate signal (for example,
  151.      kkkkiiiillllllllaaaallllllll ----TTTTEEEERRRRMMMM ssssyyyyssssllllooooggggdddd).
  152.  
  153. SSSSEEEECCCCUUUURRRRIIIITTTTYYYY CCCCOOOONNNNSSSSIIIIDDDDEEEERRRRAAAATTTTIIIIOOOONNNNSSSS
  154.      _s_y_s_l_o_g_d creates log files in mode 644 which allows general read access.
  155.      If the log file already exists, its permissions are unchanged.  The
  156.      system administrator may wish to create separate log files with more
  157.      restricted permissions for sensitive information such as LOG_AUTH
  158.      messages.  Scripts or _c_r_o_n(1M) jobs that roll (that is save and restart
  159.      with a new file) these sensitive log files should ensure that the new log
  160.      file has the desired permissions.
  161.  
  162. FFFFIIIILLLLTTTTEEEERRRR EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  163.      This example shows how to use the filter mechanism.  To have _f_t_p_d(1M)
  164.      messages logged in a different file, add the following line to
  165.      /_e_t_c/_s_y_s_l_o_g._c_o_n_f:
  166.  
  167.           daemon,auth.debug       |/var/adm/ftpd.filt  /var/adm/ftpd.log
  168.  
  169.      The /_v_a_r/_a_d_m/_f_t_p_d._f_i_l_t file is a shell script:
  170.  
  171.           #!/bin/sh
  172.           # This filter only accepts ftpd messages
  173.           read line
  174.           set $line
  175.           case "$1" {
  176.               ftpd\[*)
  177.                   echo "$line\c"
  178.                   exit 0
  179.                   ;;
  180.           }
  181.           exit 0
  182.  
  183.  
  184. MMMMEEEESSSSSSSSAAAAGGGGEEEE EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  185.      The following is an example line from the /_v_a_r/_a_d_m/_S_Y_S_L_O_G file:
  186.  
  187.           Aug 10 10:32:53 6F:sgihost syslogd: restart
  188.  
  189.      Each line has several parts.  The date and time of the message are listed
  190.      first, followed by a priority and facility code.  Priorities are listed
  191.      as 0-7 and facilities are listed as A-T.  Reference <_s_y_s/_s_y_s_l_o_g._h>.  The
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ssssyyyyssssllllooooggggdddd((((1111MMMM))))                                                        ssssyyyyssssllllooooggggdddd((((1111MMMM))))
  203.  
  204.  
  205.  
  206.      source is the name of the program that generated the message.  Following
  207.      the source is the message itself.
  208.  
  209. FFFFIIIILLLLEEEESSSS
  210.      /etc/syslog.conf              default configuration file
  211.      /dev/log                      device read by _s_y_s_l_o_g_d
  212.      /dev/klog                     the kernel log device
  213.      /usr/sbin/klogpp              filter for kernel messages
  214.      /etc/config/syslogd.options   command-line flags used at system startup
  215.  
  216. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  217.      logger(1), sysmon(1M), syslog(3C).
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.